package com.qf.controller;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 查询用户列表
 * @author 千锋健哥
 */
@WebServlet("/AdminList")
public class AdminListServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        this.doPost(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("======= 访问到了AdminListServlet的doPost方法==========");
        //1. 设置请求对象的字符集
        req.setCharacterEncoding("utf-8");
        //2. 获取请求对象中的参数
        //获取用户名
        String username = req.getParameter("username");
        //获取密码
        String pwd = req.getParameter("pwd");

        System.out.println("=====username=====" + username);
        System.out.println("====pwd======" + pwd);
    }

}
